Fix teardown to clean up operator namespace#82
Conversation
There was a problem hiding this comment.
I see the issue, I am not 100% convinced that this is the way we should be doing it this way.
Why: I always tried to make roxie as snappy as possible to optimize for feedback cycles during development/testing.
With this change we would add some work for each new deployment (of the entire stack), namely redeploying the operator and waiting until it is ready. Currently roxie is treating the operator like some sort of implementation detail and automatically takes care of desired up- & downgrades when necessary. I personally think that this is working quite nicely.
What's your opinion on this?
At the same time I do understand that there might be use-cases for also cleaning up on the cluster entirely.
So, I am thinking, maybe we should provide ways to do both, but be explicit about it.
Just an idea, what about we stop treating "both" and "all" to mean the same thing? For example, "both" could mean "central & securedcluster" while "all" could mean "both + also the operator"?
This way we would get around introducing some flag like --all, which would make an invocation such as
roxie teardown all --all
seem a bit weird.
Let me also tag @porridge on this one.
|
+1 to @mclasmeier 's idea |
Thank you for the reminder, will TAL. |
|
@mclasmeier @porridge thanks so much for your comments! I've made some pretty big changes, PTAL! |
654ddad to
db3a7ac
Compare
mclasmeier
left a comment
There was a problem hiding this comment.
Awesome. Looking good, just 2 nits.
- Revert deployOperator rename back to ensureOperatorDeployed - Remove unused IncludesOperator() function
Fixes #72 - adds
bothvsalldistinction for teardown behavior.Changes:
teardown both- removes central + sensor, keeps operator (fast iteration)teardown all- removes central + sensor + operator (full cleanup)Default teardown is now
allfor complete cleanupTeardowns run in parallel for better performance
Operator deployment is now explicit instead of hidden in central/sensor deployment
Added
app.kubernetes.io/managed-by=roxielabel to operator namespaceBreaking change: Default teardown behavior changed from leaving operator behind to removing it. Use
teardown bothfor the old behavior.Manual testing:
Default behavior (
all):./roxie deploy --resources=small→ deployed central + sensor + operator./roxie teardown→ removed all three includingrhacs-operator-systemnamespacebothvsalldistinction:./roxie deploy all --resources=small→ deployed everything./roxie teardown both→ central/sensor resources deleted, operator kept running./roxie teardown all→ operator removedSingle namespace mode:
./roxie deploy --single-namespace --resources=small→stackroxnamespace labeled withmanaged-by=roxie./roxie teardown --single-namespace→ cleaned up including operatorParallel teardown verified - all three components started teardown simultaneously (logged at 00:01), finished independently.